const {User} = require("../../../models/User");

module.exports = async (req, res) => {
    var Art_No = req.query.Art_No;
    var currentUserId = req.query.user_id
    try{
       const collect = await User.findOne({user_id:currentUserId,"collections.Art_No":Art_No})
       let isCollect = false;
       if(collect){
            isCollect = true;
       }
       res.send({errCode:"0",msg:"success",data:{isCollect:isCollect}})
    }catch(e){
        res.status(400).send({errCode:"1",msg:"请先登录"})
    }
}